function[time]= jobshopstats (minResources, maxResources,samples,maxtime)
	time = [];
	DIR = '../data/stats/';
	MKDIR = 'mkdir -p';
	EXTENSION = 'pdf';
	FILENAME_HIST = 'hist';
	FILENAME_DATA = 'runtime';
	FILENAME_AVERAGE_RUNTIME = 'runtime';
	unix(sprintf('%s %s', MKDIR,DIR));
	
	mean_time = [];
	
	for i=minResources:maxResources
		for j=1:samples
			[StartTimes,runtime]=jobshop(  floor(i*rand(i))	, floor((maxtime+1)*rand(i)))
			time(i-minResources+1,j)=runtime;
		end;
		hist(time(i-minResources+1,:))
		xlabel('t[ms]')
		ylabel('N[-]')
		title(sprintf('Doby behu pro velikost problemu %d ',i))
		t = clock;
		saveas(gcf,sprintf('%s%s_s%d_%d_%d__%d_%d.%s',DIR,FILENAME_HIST,i,t(3),t(2),t(4),t(5),EXTENSION));
		close(1)
		mean_time(i-minResources+1) = mean(time(i-minResources+1,:));

	end;
	
	plot(minResources:maxResources,mean_time);
	xlabel('velikost problemu [n]');
	ylabel('stredni doba behu [ms]');
	title('Zavislost stredni doby behu na velikosti problemu');
	saveas(gcf,sprintf('%s%s_%d_%d__%d_%d.%s',DIR,FILENAME_AVERAGE_RUNTIME,t(3),t(2),t(4),t(5),EXTENSION));
	close(1)
	t = clock;
	filename =sprintf('%s%s_%d_%d__%d_%d.mat',DIR,FILENAME_DATA,t(3),t(2),t(4),t(5)) 
	save filename time
end
